Thousands flee Nigerian town to escape from militants