Replace hand-written Makefile with CMake build script