Should use LIBDIRS and explicitely list dependencies as LIBS instead.