Answer
$10$ seconds
Work Step by Step
Let's note by $s$ the time (in seconds) and by $m$ the distance (in miles).
We write the equation connecting $s$ and $m$: $$m=\dfrac{s}{5}.\tag{1}$$ We substitute $m=2$ in equation $(1)$ to find $s$: $$2=\dfrac{s}{5}.$$ Multiply each side by $5$: $$s=10.$$ Therefore the thunderstorm is $10$ seconds away.