Add -pthread to CFLAGS