Fix buffer overflow
Add Makefile