Makefile: added -g flag for debugging, main.c: fixed stack smashing leak by clearing buffer