Fix qt pthread compilation

Fix pthread compilation in the same way as was done for tests