I have always heard it the other way: "If the mountain won't go to Muhammad, the Muhammad must go to the mountain." I interpret this to be sure to recognize what is possible and not possible. It is foolish to try to accomplish an objective (Muhammad meets the mountain) in an impossible way. Better to find a sensible approach. Work with the world as it is, and accomplish your objectives, rather than trying to change the entire world so that your corner of the world is the way you want it.
I found this reference:
The phrase originates from Francis Bacon: "Mahomet made the people believe that he would call a hill to him, and from the top of it offer up his prayers for the observers of his law. The people assembled: Mahomet called the hill to come to him again and again: and when the hill stood still, he was never a whit abashed, but said, "If the hill will not come to Mahomet, Mahomet will go to the hill."