free sources in the end of server,and fix the makefile