Fixed some build issues picked up by gcc.  Made some changes to cmake files, primarily to do with blas and lapack being linked with armadillo.