There are two other problems with this mindset. The first is that objectively quantifying the benefit vs. downside of marginalizing a particular group doesn't happen. Instead, feelings and opinions seep in -- a fear of the "other", if you will. The second is that, by marginalizing a group, you more often that not end up making your problem worse.
The "other way" is to try to understand the root causes behind such attacks, and work with the communities that are closest; in this case, Muslim communities around America. It's quite known by now that American Muslims are very willing to cooperate with authorities when the need arises.