add pthread and additional include for ubuntu