Add -lpthread to CFLAGS