Add build setup for testing ws_object with check

Fix for including libpthread included.