Can't write to /usr/lib

Solution 1:

It is a new feature of OS X 10.11 (El Capitan): SIP.

System Integrity Protection (SIP,1 sometimes referred to as rootless2) is a security feature of OS X El Capitan, the operating system by Apple Inc.

...

Among the protected locations are: /System, /bin, /sbin and /usr (but not /usr/local).

System Integrity Protection on Wikipedia

It can be disabled: Stack Exchange thread

In summary, from the Recovery partition, open Terminal.app and run: csrutil disable

...

Update: SIP has been expanded in High Sierra (macOS 10.13)

KB on Apple's Support Site