Added gitignore and fixed some errors in the source code and makefile