Thousands flee in Philippines as typhoon strengthens