Added support for compile_commands.json and updated makefile

For cmake projects that does not use GNU make the compiler commands can be exported
by passing the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON flag to cmake
this will generate a JSON file in the build directory called compile_commands.json
see: http://clang.llvm.org/docs/JSONCompilationDatabase.html

example using ninja-build: cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. && ninja