I'm studying from Goldstein's Classical Mechanics, 3rd edition. In section 2.4, he discusses non-holonomic systems. We assume that the constraints can be put in the form $$f_\alpha(q, \dot{q}, t) =0, \qquad \alpha = 1 \dots m.\tag{2.20}$$ Then it also holds that $$\sum \lambda_\alpha f_\alpha = 0.\tag{2.21}$$ Using Hamilton's principle (i.e. that the action must be stationary), we get that
$$\delta \int_1^2 L\ dt = \int_1^2 dt\ \sum_{k=1}^n \left(\frac{\partial L}{\partial q_k} - \frac{d}{dt}\frac{\partial L}{\partial \dot{q_k}}\right)\delta q_k = 0\tag{2.22}. $$
But we can't get Lagrange's equations from this because the $\delta q_k$ aren't independent. However, if we add this with $\sum \lambda_\alpha f_\alpha = 0$, it follows that
$$\delta \int_{t_1}^{t_2} \left(L +\sum_{\alpha=1}^m \lambda_\alpha f_\alpha\right)\ dt = 0.\tag{2.23}$$
And then Goldstein says that
The variation can now be performed with the $n\, \delta q_i$ and $m\, \lambda_\alpha$ for $m+n$ independent variables.
Why have the variables suddenly become independent? First we had $n$ dependent variables, why do we now have $m+n$ independent ones?