fix some bug and modify makefile