The -pthread argument is stored in config.ldflags instead of config.cflags.