Fix makefile and small errors