Where does the ground wire go in a 3-prong dryer cord configuration?
DO NOT connect the ground wire to the grounded (neutral) conductor, as this could lead to current flowing through the body of the dryer (and potentially through you).
The installation guide for the dryer will have wiring instructions for both 3, and 4 wire configurations.  Check the manufacturers documentation for proper wiring, but I would say the first image is likely correct.


Instructions from random Maytag Installation Instructions (PDF)
3 Wire Cord



4 Wire Cord




Update:
After doing some research, and looking at dryer wiring diagrams. It turns out that the green/yellow wire is not a ground wire, it is a neutral to case bonding wire. When this wire is not in use (in a 4-wire installation for example), it is simply connected to the neutral terminal and is unused.