It's worth noting that illegal immigration was never a "problem" in this country until we had a massive government in place that introduced major distortions in the marketplace for labor and other services.
You didn't hear so many complaints about illegal immigration back in the latter half of the 19th century (the term "illegal immigrant" may have even been completely meaningless back then) -- mainly because the immigrant from Europe who filed a homestead claim out on the Great Plains had no financial advantage over the American citizen who owned the farm across the road. They both worked from dawn to dusk, and neither of them had the ability to use the power of government to force the other to do anything. All transactions were voluntary, and the system worked very well from a purely economic standpoint.