Generalized Gear's method for computing the flow of a viscoelastic fluid