What glibc does to provide almost the same feature is to define stub functions for most of the pthread library in glibc. These calls do nothing and are very fast.
Once libpthread.so is linked in, its symbols override the weak glibc symbols and then the real functions are called.
So include pthread and call the locking functions, but don't link with it.