There is no way to prevent terrorist act if some organization decides to do so, regardless of what level of security government provides. This organization shouldn't be very advanced, rich, or powerful, and actually, it can be only one person. Example of Timothy McVeigh proves this point. So, there are only several ways to decrease the possibility of such attacks. The most of these ways are an issue of changing current immigration laws, since terrorist acts were undertaken by aliens. I can think of several scenarios of changing these laws. There is only one rule: severity of the laws is directly proportional to the level of security inside the country.
Scenario number one is the strictest. Change laws so, that only foreigners who can prove that USA really needs them could enter the country. They can be scientists, or unique specialists, like sportsmen, artists, and so on. No more illegal immigrants.
Everyone without documents must immediately leave the country. No more international students. The problem of family reunification can be resolved in two ways. First, allow only closest relatives to enter the country (spouse and kids under 21). Second way is simply do not allow relatives to enter the country. This scenario is the least realistic, but it provides almost 100 percent guarantee that no more terrorist acts will take place. It is not realistic, because modern US economy is based on using cheap labor of illegal immigrants, so the economy must be totally restructured in this case.
Next scenario is basically consists of making immigration laws more strict for Islamic countries and any other countries that support terrorist groups. Although it is not a democratic way, but it will decrease the probability of future attacks, because the reasons of the attacks are based on religious distinctions between Islamic countries...