make sure libjulia is linked against libz

Recently issue #4742 resurfaced. It turns out that we get strange link errors involving libz in the specific and unusual case of linking an executable to a library that depends on libjulia, where the executable itself does not depend on libjulia. In other words:

```
g++ prog.o -o prog -lotherlib -ljulia -lz
```

where `otherlib` uses `libjulia.so`, kept giving the #4742 error. In `ldd`, the julia executable has a reference to `libz`, but `libjulia.so` does not.

I was able to fix this by reordering the libjulia link line. After this change, libjulia had a reference to libz, and everything worked.

Further, (1) `llvm-config` does not have a `--system-libs` option, and (2) the julia executable might not need llvm's ldflags, since it only really depends on libjulia. This works on linux, however other OSes might need this, so the `ui/Makefile` change is optional. This needs to be tested on all platforms.