On computing root polynomials and minimal bases of matrix pencils