Added `-threaded` to Makefile build-main
Handle hClose exceptions and temporarily disable hostname lookups