What do I do when migraine medicine wont work?

Keep a diary. If correct preventative measures are taken , most patients improve.If your headache is truly intractable, try keeping a diary of headaches to identify trigger factors, look into your life style and total life situation, biofeedback? Botox injections? Treating coexistent problems such as hypertension or depression?
Migraine medications. To be effective, migraine medications must be taken early in the headache before it gets bad. Waiting untill you are sure its a migraine may be too late for the medicine to work. Also, not every migraine medication works for everybody. In some cases, people have to try multiple medications before they find the right one. My advice; use the best medication early in the headache.