As we don't have the political will to round them up any more (nor do I necessary want our increasingly statist govt going door to door anyway) I'm all for building a fence, while concurrently enforcing existing law.
With the ones who are here, it's very simple: they get temporary status, and while on it they must have a job (or if they lose it to a layoff, find another within say, 6 to 9 months), no welfare, no convictions above traffic violations.
They get to the back of the line to get some sort of legal status, whether a green card, visa, citizenship, whatever. As long as they're in the process to recieve one of these they are good. If they leave that at any time they're gone.
Employers must verify legal status, anyone who doesn't have it must get a temporary card. They can sponsor those workers for permanent status if they wish. Status can be verified by applying or reapplying for a drivers license which can be used for gaining employment. No one can work legally who can't prove they should be here.
Any type of public ior fiduciary entity must verify status. Govt, hospitals, financial institutions, etc. Close off the avenues that allow people to exist illegally and many will end up back home voluntarily or otherwise.
In the meantime, create reciprocal immigration agreements. If it's stricter than ours, mirror it. Tie immigration to trade agreements and if they want freer access to our country, we need freer access to theirs, simple as that.
It will not solve the problem overnite, but the next 10 years or so it will. It's the best solution I can think of.