main diff from jsg@ with some tweaks from me
* Use -pthread instead of -lpthread in configure. * Fix a few pointer to int casts. From: Jacob Meuser <jakemsr@jakemsr.com>