Essentially, you can solve this using the process you describe, but twice, to generate two equations in two variables, and then solving for each variable as a "system of equations".
We have:
$$ \dfrac{p-1}{q} = \dfrac{q-1}{2p+1} = \dfrac {3}{5}$$
Equation 1: $\quad 5(p-1) = 3q \iff 5p - 3q = 5$
Equation 2: $\quad 5(q-1) = 3(2p +1) \iff -6p +5q=8$
So your system of two equations in two unknowns becomes:
$$5p - 3q = 5\tag{1}$$ $$-6p +5q=8\tag{2}$$
Can you take it from there?
You can express (1) as a function of p (isolate p), and then substitute the expression obtained for p, into p in (2), and then solve for q, then p,
or
You can use "row operations": multiply (1) by 5 (both sides), and (2) by 3 (both sides):
$$25p-15q=25\tag{1}$$ $$-18p+15q = 24\tag{2}$$
Now add the equations (q disappears), solve for p, then "plug" p into one of the original equations and solve for q:
$$7p = 49n\implies p = 7$$
Now...From (1), originally, above
$$5p-3q=5 \implies 5(7) - 3q = 5\implies 35 - 3q = 5$$ $$\implies -3q=-30 \implies q = 10$$