I have to say that it seems very likely that lifting weights and your migraines/headaches are linked and in this case, you will need to treat the cause rather than the symptoms to gain some long term releif.
It sounds very much as if you have either strained or torn a muscle whilst lifting weights that has caused these headaches. You would probably benefit from going to see a Chriopractor, an Osteopath or a Sports Massage Therapist to help this to heal. It may take sometime though, so you have to be patient.
Possibly any of the above or some acupuncture treatment could help control your pain.