Adding makefile and sovling some issues