Fix makefiles and update .gitignore