That solution is far from obvious.  The actual solution is, I think, already in the tax code.  Make sure the entity that claims that it is a charity actually does some kind of charitable work.  Then, the fake church that operates out of a storefront and exists solely to criticize a candidate and do it in a tax-exempt way (i.e., the reason for the amendment in the first place) does not get to claim tax-exempt status, but actual churches do.