fix bugs when building without mkl