Linux pthread fix

Fixes #41. I've checked this fix on both Linux (Ubuntu 13.10) and OS X. This fixes the Linux build and doesn't break the OS X build. I don't have a Windows box to test on but I don't see why it would break it.