Need to put the -g flag in both CFLAGS and CXXFLAGS.