build: Update ax_pthread.m4 and move it to common