Add CMake and fix linux compilation