I find myself a gear that is workable in the headwinds and lock into it. Then I start a little deep breathing and focus on that and if the road is decent and fairly straight I switch to auto pilot and start thinking of other things. If a circumstances allow me to speed-up I pick up on it pretty quick, but as soon as that headwind kicks in again I start again.
The trick is to learn to be able to ignore the headwind as soon as possible. Kind of zen style.