some small 'bugs' and CMAKE

In case someone else tries to build this code using g++ on GNU/Linux this should make it compile without errors. The CMakeLists.txt just makes for a little bit less typing in the terminal until you have a binary