Makefile: new 'dist' target

Creates a distribution directory
Error handling and reconnect