On-shell improved lattice gauge theories