Add -pthread to the CFLAGS

This is actually necessary on a lot of platforms.  Otherwise, the
code can build fine, but pthread_atfork becomes a no-op.