CMake improvements

Handles lack of libraries and different usernames better.