This is absolutely correct. You can't tell a Muslim by looking at him, nor can you tell one by the name (unless he's named Mohammed).
After we exclude all the men named Mohammed, are we safe?
I actually know an African Christian pastor (an American citizen now, living here) named Mohammed.
I kid him saying, "well I'm glad Mohammed finally got saved!"
You really never can tell.
If there was a way to do it? Would we be safer?
Well, extra surveillance on all Mohammeds, Husseins, Alis, Osamas, Ismaels, and Abdullahs (whether as first or middle name) and their known associates, probably would cut down the terrorists options quite a lot.
A good scholar of Islam could doubtless lengthen the list with a few more distinctly Muslim names.