Add -pthread to LDFLAGS