Repeat after me: if X (X.org or XFree86) has XTHREADS defined in Xlib it does NOT automatically mean you have to add -lpthread to your LIBS line.
I still wonder which smart person got that generalistic idea.
In this case it is glitz from the Cairo Graphics project to run dead on DragonFly. *sigh*