Erdogan draws on history to slam modern enemies