fixed a few CMake issues under Linux

I have fixed a couple of CMake-related issues when compiling under linux in a non-standard install path. See the commit comments for more details.
Regards