Gold futures mark largest monthly gain since June