Heat 3 tablespoons olive oil in a large skillet over medium heat. Add the onion and cook until soft, about 5 minutes. Stir in the garlic, anchovies, red pepper flakes, and capers and fry for 2-3 minutes. Add the tomato puree, olives, black pepper, and 2 tablespoons basil. Bring to a boil and then turn heat to low and simmer, stirring occasionally, until thickened and juice from tomatoes is boiled off, about 15 minutes.