An agreement is needed to prevent countries from freeriding on others’ efforts, writes Jeffrey Sachs