Now look at what you just said. You quoted an exact percentage, and then had no idea how many folks to apply it to. 12 or 20 million? My point is this: that 40% figure is dubious, very dubious. The biggest part of the problem is due to those who crossed the border illegally and the way to stop the biggest bleeding is to stop that.
There is no doubt that we really don't know how many illegal aliens are here or how they got here. We do have the government and various think tanks that use available data to estimate numbers. Both Dems and Reps have come to the 40% number. Pew and CIS have also used that estimate. Securing the border only solves part of the problem. The US-VISIT act of 1996 was supposed to set up a system to track down and deport visa overstays. It was never fully implemented.
We have over 50 million visitors to the US annually. There are over 700,000 foreign students in the US and millions of guest workers. This is a major challenge to keep tract of them.