Exit pthread error a 'little' more gracefully - avoided double free()s.

Prior method ran into double free problem. pthread_detach improved it a bit
and 'return -1' avoids a seg fault problem. Also Undid a Makefile.am edit.