Generalized Friedmann equations for a finite thick brane