This type of attack is unfortunately the new normal. It can't be stopped in an open society. With out resorting to draconian measures.
Of the best types of defense against terrorism, it's intelligence agencies that actually stand a chance. Find out who the enemies are, infiltrate their ranks, stop them before they actually attempt an attack. Once terrorists actually get to the point of launching the attack, it is too late to really stop them. Problem is, the intelligence forces never get to everybody; they usually have more information than they have resources to follow-up, and the work is covert so people are often unsatisfied that action is being taken at all, because they cannot see it until the very end of the process.
As for "screening" types of defenses, they are of only two uses:
1) The public can see screening, so they feel like something is being done on their behalf. Truthfully, terrorists can pick virtually anything & anywhere to attack. Can't attack the military or the government HQ? Try a train station or airport or ferryl? Too much security there? Try a stadium, a hospital, or a mall. No? How about a parade, a festival, even a funeral ? Anywhere people congregate, they can be killed in large numbers. And even failing that, you can individually assassinate civic leaders or celebrities. This realization leads to ...
2) "Harden" certain targets so that terrorists will pick some other target instead. It's a cold-blooded logic, but the authorities would rather see terrorists "persuaded" to kill 100 people in a shopping mall than damage a nuclear power plant or a dam. Sounds harsh, but honestly the latter kind of target would be far worse.
As you said, there are so many potential targets, the public needs to just realize there is no such thing as total safety in an open society. Snuff out the source of the trouble, and in the meantime, just have the resilience to endure what attacks still make it through.