A clayish subterranean formation, such as may be encountered in rock surrounding a well bore during hydrocarbon recovery operations may be stabilized with relatively high molecular weight acid ammonium salts of an imide of polymaleic anhydride. The salts may be unneutralized or partially neutralized. The invention is particularly relevant to hydraulic fracturing fluids used in enhanced oil recovery. The compositions herein are made in the presence of a reactive solvent, such as a polyalkylene glycol, e.g. polyethylene glycol. The compositions of this invention are more environmentally friendly than some current technology.