Maybe give her really high value treats before and after- something she LOVES, maybe even a little bit of your dinner? That's what my family does with our dog that has chronic ear infections- she gets a yummy treat/some people food after she gets dosed.
You could also try making a game out of pretending to give her the medication- act like you're going to do it, hold her for a second, and then give her a treat. This may not make it any less unpleasant to get her meds (my guess is they probably hurt a lot), but it would keep her from thinking people touching her ears means pain and reacting inappropriately to being touched there (I know a family whose lab would snap if you touched his ears following an ear infection; it made petting him kind of nerve wracking).
You could also try making a game out of pretending to give her the medication- act like you're going to do it, hold her for a second, and then give her a treat. This may not make it any less unpleasant to get her meds (my guess is they probably hurt a lot), but it would keep her from thinking people touching her ears means pain and reacting inappropriately to being touched there (I know a family whose lab would snap if you touched his ears following an ear infection; it made petting him kind of nerve wracking).