without the full error-message from build we can not help you...
leaving directory is only a info with the note, that erros occured before...so please post the errors before that message
you can also do the make like this:
"make 2> >(tee error.log)"
and then give us this error.log