Use CMake for building BAMM
Fix annoying warnings about unused variables