Added a Makefile to compile all programs
fix socket error treatment