Recall also that he actually traveled the distance $s$ at velocity $v$ in time $t$, so we have $s=vt$ as our first equation. Rewriting the other two equations slightly, by distributing (FOIL) and by simplifying the fraction $\frac{40}{60}=\frac{2}{3}$, we have $\left\{\begin{array}{l}s=vt\\s=vt-\frac{2}{3}v+3t-2\\s=vt+\frac{2}{3}v-2t-\frac{4}{3}\end{array}\right.$
We readily see (by subtracting the first equation from the other two) that $\left\{\begin{array}{l}0=-\frac{2}{3}v+3t-2\\0=\frac{2}{3}v-2t-\frac{4}{3}\end{array}\right.$ and adding those two equations together, we find that $0=t-\frac{10}{3}$, so $t=\frac{10}{3}$. Plugging that back into the first equation in the second system yields $0=-\frac{2}{3}v+10-2$, so $\frac{2}{3}v=8$, so $v=12$. Finally, since $s=vt$, we have $s=12\cdot\frac{10}{3}=40$.
I only posted to expand on Julian's answer! He likely assumed that you could then solve the system of three linear equations in three variables, and so glossed over the details. Feel free to upvote my answer, if it's helpful, but you should arguably accept his over mine.