Maximizers for Gagliardo–Nirenberg inequalities and related non-local problems