Fix compilations error debian/testing (gcc version 4.8.2)

* Fix issue while linking pthread: "DSO missing from command line"
* Add missing header required for usleep