Add pthread detection

It is needed by spl_init.c.