You have a infection of lung left ,as a complication thin layer which covers lungs Pleura
also gets inflamed and this is pain sensitive structure so it is painful during coughing,Sneezing
and even yawaning can bring pain. But duration is long as 1 month time every Pneumonia
should heal completely by this time. You should go for check up again may be a repeat X ray
to see if Pnumonia resolved completely and there is no other patology. Is it pleura or rib which is causing so much pain.
If required go for a ultrsound/CT Scan
study to know the cause of your pain . I think you should see a expert.Hope you will be OK soon.