Added reciving thread. Updated Makefile