Ibuprofen is not safe for animals. I don't know of any OTC pain medication that is safe for animals but others here might. You should probably pick up some rimadyl or something similar from your vet.
You can find aspirin for dogs in pet stores and pet sections in Walmart and the like. It will have the dosage on the label based on the weight of your dog.
We went to our vet and got a script for pain meds and ordered the HUGE bottle from pet meds from his suggestion. My dog is also old so we aren't too worried about long term effects. It was like $1 a pill and made a huge difference