C7 ( 1-3-5-flat7) is suppose to contain a G as its 5th right? So how does a guitar get away with this in open position?
Without the 7, it wouldn't be a 7th. Without the 3rd, it wouldn't be major or minor. Without the root, it wouldn't be the chord that it is. But the fifth doesn't contribute any vital property of the chord.
There is this other fretting option which gives you a G:
One reason why the perfect fifth can be left out is that the note is sounded within the root. It's the second harmonic, so it's there anyway, albeit in a quiet way, although some instruments will let it sound better than others.