In The Martian (by Andy Weir) book, MAV fuel plant was able to make fuel using Martian atmosphere, but the process was slow. From Chapter 1:
The most important piece of the advance supplies, of course, was the MAV. The Mars ascent vehicle. That was how we would get back to Hermes after surface operations were complete. The MAV was soft-landed (as opposed to the balloon bounce-fest the other supplies had). Of course, it was in constant communication with Houston, and if there had been any problem with it, we would have passed by Mars and gone home without ever landing.
The MAV is pretty cool. Turns out, through a neat set of chemical reactions with the Martian atmosphere, for every kilogram of hydrogen you bring to Mars, you can make thirteen kilograms of fuel. It's a slow process, though. It takes twenty-four months to fill the tank. That's why they sent it long before we got here.
Just before Ares 3 crew landed, Martinez remotely landed MAV to Ares 4 site. Mark Watney reached Ares 4 site after about 1.5 years (i.e. less than 24 months). It means Ares 4 MAV didn't make fuel out of even all hydrogen on-board. Yet, NASA ordered Mark Watney to give MAV more hydrogen. From Chapter 25:
[13:07] HOUSTON: Congratulations from all of us here at Mission Control! Well done! What's your status?
[13:21] MAV: Thanks! No health or physical problems. The rover and trailer are getting pretty worn out, but still functional. Oxygenator and regulator both working fine. I didn't bring the water reclaimer. Just brought the water. Plenty of potatoes left. I'm good to last till 549.
[13:36] HOUSTON: Glad to hear it. Hermes is still on track for a Sol 549 flyby. As you know, the MAV will need to lose some weight to make the intercept. We're going to get you those procedures within the day. How much water do you have? What did you do with urine?
[13:50] MAV: I have 550 liters of remaining water. I've been dumping urine outside along the way.
[14:05] HOUSTON: Preserve all water. Don't do any more urine dumps. Store it somewhere. Turn the rover's radio on and leave it on. We can contact it through the MAV.
Later in Chapter 25:
Venkat flipped through the pages. "Care to summarize?"
"First, we're going to add fuel. The MAV makes its own fuel from the Martian atmosphere, but it's limited by how much hydrogen it has. It brought enough to make 19,397 kilograms of fuel, as it was designed to do. If we can give it more hydrogen, it can make more."
"How much more?"
"For every kilogram of hydrogen, it can make thirteen kilograms of fuel. Watney has five hundred and fifty liters of water. We'll have him electrolyze it to get sixty kilograms of hydrogen." Bruce reached over the desk and flipped a few pages, pointing to diagram. "The fuel plant can make seven hundred and eighty kilograms of fuel from that."
On Sol 529, Mark Watney did start the process of converting water into rocket fuel, by supplying fuel plant extra hydrogen. But, MAV took flight on Sol 549 i.e. after 20 Sols. First, MAV hadn't yet converted existing hydrogen to fuel and Mark added extra 60Kg of hydrogen. How was MAV fuel plant able to do hundreds of Sols of work within 20 Sols? Did I miss something? Or, is it a plot hole (I am less inclined to expect this because of scientific accuracies of the book)?