Fixed order of libraries to link for unit tests using automake.