On generalized Legendre matrices involving roots of unity over finite fields