As usual, the muscles used in cycling are most easily and efficiently strengthened by cycling. For your hams and hip flexors try this: next time you come to a long hill that's not steep (say 2%-4%), gear down a bunch, unclip on one side and prop that foot in the frame triangle. Pedal one-legged until you achieve no-workee, then switch legs. You must keep a taut chain the whole time. A momentarily slack chain is failure. Go back and forth until nothing works anymore. Ride home. You may have to put your bottles in your jersey pockets to make room for your foot. You will not believe what a difference doing this once or twice a week will make.
While you are doing this, think of the one-legged cyclists who can ride over 30 mph. You have my permission to worship them.