The secretive program, financed in part with millions of dollars in classified Pentagon spending and carried out by trainers, including members of the Army’s Green Berets and Delta Force, was begun last year to instruct and equip hundreds of handpicked commandos in Libya, Niger, Mauritania and Mali.