Turkish President Recep Tayyip Erdogan has vowed to bring terrorism "to its knees" after an attack in the capital Ankara that killed at least 34 people.