Suppose the make
fails:
$ make
Launch it instead with make VERBOSE=1
to see the commands executed. Then directly run the linker or compiler command that you'll see. Try to make it work by adding necessary flags or libraries.
Then figure out what to change, so CMake itself can pass correct arguments to the compiler/linker command:
CMakeLists.txt
of the project or the library detection scripts like FindSomeLib.cmake
To help in that, add message(${MY_VARIABLE})
calls into CMakeLists.txt
or *.cmake
to debug variables that you want to inspect.