Link -pthread explicitly.

DSO linking rules require this.