Add -pthread to the LDFLAGS.