The most important thing:
if you use custom makefiles, you are responsible to chose a debug target (if any exists) or to make sure the "-g" flag is set inside the Makefile for the target you want to debug.
And that no stripping options are set, best is to comile without optimizations, but it might or might not work with optimization, depending on your code, compiler debugger (and the versions of it).