Tunisia and Libya announced Thursday they had agreed to share responsibility for providing shelter for hundreds of migrants stranded at their border, many of them for over a month.