Estimating free parameters in 2D inversion: example of gravity inversion in a rifted basement