Libyan military officials say they have apprehended hundreds of migrants traversing the country's vast desert.