Headache and quick ejaculation are unrelated to each other. Both are independent problems, and needs to be managed independently. Quick ejaculation could be a problem of premature ejaculation. It is completely curable with suitable medication and instructions. For headache, you must consult with a psychiatrist in detail.
Next Steps
Kindly consult with a psychiatrist.
Health Tips
Don't worry. They are treatable.