build: add AX_PTHREAD macro and error message.

Provide friendlier error on weird systems.