Terrorist groups can influence the economies of the rich world in two main ways.
First, terrorist groups can disrupt the societies of countries that are far from the rich world but which are important to its economies. The most prominent of such countries are those countries from which the rich world gets much of its oil. For example, if Boko Haram disrupts Nigerian society and, better yet, the areas of Nigeria where oil is produced, it can reduce the amount of oil being produced in Nigeria. This will hurt the West because it will tend to cause the price of oil to rise.
Second, terrorist groups can harm rich world economies by inducing them to spend money on security and to create inconveniences by doing so. The 9/11 attacks caused the US to spend huge amounts of money on wars. This hurt the US economy. The attacks also led to a lot of new security measures that inhibit economic activity to at least some degree. The measures made it harder to get visas to visit the US, thus reducing tourism. They make air travel less pleasurable, potentially reducing the degree to which people will do it. If terrorists can scare Americans badly enough, they might be able to cause even more security bottlenecks that will make the US economy less efficient.