Build a wall that people can't cross. Allowing people to sneak across the border simply exacerbates the problem. Mexico gov't doesn't have to deal with the issue that way so it does little about people leaving. People see a better living across the border so they leave Mexico.
Primitivo Rodriguez, an advisor to the Mex. gov't and a member of the AFSC, said, "Until now the policy of the United States has not been to close the border to illegal migration, but to detour it. And by detouring it they have caused unprecedented levels of death, abuse and organized crime." So if you want to control the border, control all of it.
Jorges Santibanez, the pres. of the College of Northern Border, says, "For too long, Mexico has boasted about immigrants leaving, calling them national heroes, instead of describing them as actors in a national tragedy. And it has boasted about the growth of remittances as an indicator of success, when it is really an indicator of failure."
Not to mention that the illegal emigration is crappy for family life, Mexico's workforce, and the poorest Mexicans are too poor to emigrate, so you get the extremely poor, the rich, and what's left of the middle classes are families without wage earners.
A boost in their economy would help, too.