add lib m to build scripts for cholesky and jacobi-heat