fixes for make file
compile tweaks for gcc
more tweaks to get channels shutting down correctly