Make the makefile and debug handling cleaner.