Answer
The speed of the object before it strikes the ground is $v = \sqrt{v_0^2 + 2gh}$.
Work Step by Step
From kinematic equations in two dimensions, the distances along $x$ and along $y$ are given by
$$\begin{align}
x &= x_0 + v_{0x}t \\
y &= y_0 + v_{0y}t - \dfrac{1}{2} gt^2
\end{align}
$$ Since the rock is thrown at an initial speed of $v_0$ at an angle $\alpha_0$ from the horizontal, from the roof of a building of height $h$, then
$$\begin{align}
y_0 &= h \\
v_{0x} &= v_0 \cos \alpha_0 \\
v_{0y} &= v_0 \sin \alpha_0
\end{align}
$$ Substituting, we have
$$\begin{align}
x &= x_0 + v_0 t \cos \alpha_0 \\
y &= h + v_0 t \sin \alpha_0 - \dfrac{1}{2} gt^2
\end{align}
$$ Before the rock hits the ground, $y = 0$, and we get an expression for $h$ as $$ h = -v_0 t \sin \alpha_0 + \dfrac{1}{2} gt^2 $$ which will be useful later. Now we determine the components of the rock's velocity:
$$\begin{align}
v_x = \dfrac{\mathrm{d}x}{\mathrm{d}t} &= v_0 \cos \alpha_0 \\
v_y = \dfrac{\mathrm{d}y}{\mathrm{d}t} &= v_0 \sin \alpha_0 - gt
\end{align}
$$ The speed of the rock just before it hits the ground is determined as
$$\begin{align}
v &= \sqrt{v_x^2 + v_y^2} = \sqrt{\left( v_0 \cos \alpha_0 \right)^2 + \left( v_0 \sin \alpha_0 - gt \right)^2} \\
&= \sqrt{v_0^2 \cos^2 \alpha_0 + v_0^2 \sin^2 \alpha_0 - 2g v_0 t \sin \alpha_0 + g^2 t^2}
\end{align}
$$ By regrouping and factoring, we have $$ v = \sqrt{v_0^2 \left( \cos^2 \alpha_0 + \sin^2 \alpha_0 \right) + 2g \left( -v_0 t \sin \alpha_0 + \dfrac{1}{2} gt^2 \right)} $$ We recognize that the first grouping is a trigonometric identity, $\cos^2 \alpha_0 + \sin^2 \alpha_0 = 1$, and the second being the expression for $h$. Simplifying, we have the speed of the rock just before it hits the ground, $$ v = \sqrt{v_0^2 + 2gh} $$ noting that it is independent of the angle $\alpha_0$.