You could have fractured a rib during a bout of severe cough which is known to occur. The pain is because of the cracked rib. You should get a xray chest done as it will confirm the diagnosis of fracture rib and rule out any other lung pathology. I hope you have been treated for bronchitis
and whooping cough
if it was positive as mentioned by you. Take frequent nebulization with salsol and budecort
and a painkiller like tyelenol. I the pain is unbearable, consult a surgeon/orthopedician who may strap the portion of your left rib cage
with the fractured rib.