fixed some  errors and add makefile