It's an extremely complicated and serious issue. Turning the boat away very likely means death for its inhabitants - or at least a large number of them. Obviously, though, allowing everyone who makes the journey to settle in Europe is unsustainable. To make things worse, the processing centers are overwhelmed.
At the moment we're already at a point where the system for identifying and assisting refugees has failed, because it can't cope with the sheer numbers adequately. One solution is to put more resources into processing migrants on the other side of the Med, and effectively have a border there - but this would be a) just a stopgap and b)logistically complicated.
Other than that, the only real ways to actually reduce the numbers are
1. Mass killing, which is out of the question
2. Making Libya, Syria, etc., more stable and livable, as Jim said in the other thread.
Unfortunately, the latter won't happen overnight, so we are just stuck with trying to share the burden of providing those who get refugee status with our neighbours, per our legal commitments. That seems the least-bad short-term answer to me, with a foreign policy aimed at resolving the root cause over the long-term.