To do an honest comparison, we have to consider where the energy comes from for both the EV and the ICE, in use and production. In the EV, the energy can come from anywhere, but in the current grid it comes from a combination of coal (which is about as clean as the small ICE), natural gas (which, while dirty, is far cleaner than an ICE), and nuclear, hydro, wind, and air (which are all far cleaner than anything else). The ICE comes from oil, which is running out and dirty.
In production, both use the same supply of energy (a combination of oil for mining and transportation equipement, and the grid for production), but the EV does require more energy.
This means that if you clean up the grid, the ICE gets marginally cleaner. On the other hand, if you clean up the grid, the EV becomes downright sparkly. And the kicker is this: oil doesn't come out of the ground ready to put into a gas tank. You have to refine it, and it takes a lot of energy.
Ultimately, EVs are in practice, on the current grid, slightly cleaner than hybrids, which are slightly cleaner than the very best ICE. On top of that EVs have the potential to be clean enough to allow a society to survive for billions of years. With an ICE, we are looking at a few centuries at best.