Optimal dynamics in a two-sector model with natural resources and foreign direct investments