The engineers at Grumman went to extraordinary lengths to trim weight from the Lunar Module so that its single ascent engine could boost it from the lunar surface. The book Moon Lander by chief engineer Thomas J. Kelly tells the story.
The flag was extended by a wire along the top.