Wells Fargo has agreed to settle claims linked to the creation of millions of fake accounts for profit.