updating tests to link to the correct libs

#### Summary:

The last fix for #1062 didn't link the tests to the lib dependencies. This takes care of it.

#### Intended Effect:

Fixes expected behavior.

#### How to Verify:

Change a lib dependency file. Tests should all rebuild.

#### Side Effects:

More of the tests will rebuild when libstan.a or libstanc.a needs to be rebuilt. This is the correct behavior.

#### Documentation:

Not user facing.

#### Reviewer Suggestions:

Anyone.