Replace obsolete acx_pthread macro with GNU autoconf ax_pthread macro
and fix warnings.