rewrite Makefile and add debug info