Effects of synergy and discounting on cooperation in spatial public goods games