Added CMakeLists.txt, fixed compilation on gcc