fix socket delete and clean up Makefile