Fixed lapack header inclusion.
Fixed non-defined variable for lapackless systems.
Improved blas/lapack search.