put -lpthread into LIBS instead of CONFIG_LDFLAGS.