Workaround for Mac bug. Link -lpthread whenever possible