Coevolving agent strategies and network topology for the public goods games