Fix library linking for vector and matrix