Refactor Lapack and LIBS

See git commit logs for details.