I wrote:
./configure CC="cc -pthread" works.
Well, it configures. Then it fails to build shared libraries because libtool invokes ld ... -pthread, and ld does not accept -pthread. But I guess that should be reported to the libtool folks.
./configure --disable-shared CC="cc -pthread" does work.