This fixes the pthread_getspecific and pthread_setspecific calls in tls.m4. Also append pthread library in global LDFLAGS variable.