Replace makefiles with a CMake based build system.