Fix static build, setting the MBEDTLS_STATIC definition correctly and building with position independent code.