The U.S. military carried out two separate raids targeting members of al-Shabaab and al-Qaeda in Somalia and Libya.