Max had married Valerie back a million years ago, it seemed like, at Miracle School, where she worked as a potion ladler. She wasn't, of course, a witch, but when Max started practice, every miracle man had to have one, so, since Valerie didn't mind, he called her a witch in public and she learned enough of the trade to pass herself off as one under pressure.
This is a wonderful example of the resourcefulness of the text. When William Goldman needs a true love reunion, he writes his own and tells us to ask his publisher for it. When Miracle Max needs a witch, he asks his wife to stand in. Nothing is unachievable in this story; even death, which William Goldman warns us about, it easily held off by a miracle pill. Nothing is quite believable, but it all is so consistently pulled together like this, and none of the characters seem to mind, that we as the readers simply accept it and continue reading. Most of the adventure scenarios are a direct challenge to our imagination, as are the adventures in most stories of the genre. William Goldman allows us to see how the greatest miracle man acquired his witch, demystifying the process but upholding the tradition. This passage is ridiculous but somehow explicable, as is almost everything in the story.