Find the optimal labor supply when labor utility is linear
I guess you mean that the condition $-\beta +\lambda w =0$ does not include labor. But you have the profit maximizing wage relation that includes labor and wage, and so combining, you can obtain an expression that includes the marginal product of labor, and the multiplier lambda, which can be expressed in terms of the other decision variables.



Ok, I see you got lost in running around your equations.

Profits are zero since the firm is a price taker and the production function is homogeneous of degree one (constant returns to scale).

$$ \frac{\alpha}{1-\alpha}n_2 w = k q \implies n_2\frac{\beta}{\lambda} = \frac{1-\alpha}{\alpha} kq$$

Since $\lambda = 1/c_1p_1$, $q=p_1$ and $k = \bar y -c_1$we get 

$$n_2\beta c_1p_1 = \frac{1-\alpha}{\alpha} (\bar y -c_1)p_1$$

$$\implies n_2 = \frac{1-\alpha}{\alpha\beta } \left(\frac{\bar y}{c_1} -1\right)$$.

Now, go back to the budget constraint

$$c_1 p_1 + c_2 p_2 = p_1 ( \bar y - x ) + qx + wn_2 + \pi$$

Inserting the various optimal conditions, you should arrive at 

$$c_1 = \frac {\bar y}{1+\alpha \beta}$$

which leads to $n_2 = 1-\alpha$.