Reconstruction of cosmological evolution in the presence of extra dimensions